package Q2.dao;

import Q2.pojo.Student;
import lombok.NonNull;

/**
 * Student dao
 *
 * @author chisheng
 */
public interface StudentDao {

    /**
     * Insert a student to database.
     *
     * @param student Student instance
     * @return true if insert successfully, false otherwise.
     */
    boolean insertOne(@NonNull Student student);

    /**
     * Delete a student from database by primary key
     *
     * @param id student identity
     * @return true if delete successfully, false otherwise
     */
    boolean deleteByPrimaryKey(int id);

    /**
     * Update a student information by primary key
     *
     * @param student Student instance
     * @return true if update successfully, false otherwise
     */
    boolean updateByPrimaryKey(@NonNull Student student);

    /**
     * Query a student from database by specific student number
     *
     * @param number student number
     * @return a Student instance
     */
    Student findByStudentNumber(@NonNull String number);



}
